@echo off
echo    	Starting Make Message Backup package
echo -----------------------------------------------------
echo 1. Create backup package.
echo -----------------------------------------------------
echo Backuping...
start /w c:\"Program Files"\winrar\winrar.exe a -k -r -s -m5 -ibck -agYYYYMMDD-{bak}-NN D:\Backup\ D:\DCSMessage
echo Backup Finished.
echo .
echo -----------------------------------------------------
echo 2. Delete old files.
echo -----------------------------------------------------
set deltime=%date:~0,4%-%date:~5,2%-%date:~8,2%
forfiles.exe /p D:\DCSMessage /s /d -7 /c "cmd /c del /s @path >>D:\Backup\Log\%deltime%.txt"